<?php
    namespace app\admin\validate;
    use think\Validate;
    class Member extends Validate{
        protected $rule=[
            'user' => 'require|unique:menber|chsAlphaNum',
            'pwd' => 'require|min:6',
            'age' => 'require|number',
            'nickname' => 'require|chsAlphaNum',
            'email' => 'require|email',
            'phone' => 'require|number|length:11|unique:menber',
        ];
        protected $message=[
            'user.require' => '用户名不能为空',
            'user.chsAlphaNum' => '用户名只能由汉字、字母和数字组成',
            'user.unique' => '用户名已经被使用',
            'phone.unique' => '手机号已经注册过',
            'pwd.require' => '密码不能为空',
            'phone.require' => '手机不能为空',
            'email.require' => '邮箱不能为空',
            'nickname.require' => '昵称不能为空',
            'nickname.chsAlphaNum' => '昵称只能由汉字、字母和数字组成',
            'age.require' => '年龄不能为空',
            'age.number' => '年龄必须是数字',
            'pwd.min' => '密码最少六位',
            'phone.number' => '手机号必须是数字',
            'phone.length' => '手机长度必须是11位',
        ];
    }

?>